Respect which-key-min-display-lines setting
authorJustin Burkett <justin@burkett.cc>
Fri, 26 Nov 2021 03:45:35 +0000 (22:45 -0500)
committerJustin Burkett <justin@burkett.cc>
Fri, 26 Nov 2021 03:45:35 +0000 (22:45 -0500)
Fixes #325

which-key.el

index e55197ee4a05cd00dac1d92512a85d9be491abdb..0fa2fa39ad7430cb706c6765af66adf08ad3dd1c 100644 (file)
@@ -1973,6 +1973,13 @@ is the width of the live window."
             (or prefix-title
                 (which-key--maybe-get-prefix-title
                  (key-description prefix-keys))))
+      (when (and (= (which-key--pages-num-pages result) 1)
+                 (> which-key-min-display-lines
+                    (which-key--pages-height result)))
+        ;; result is shorter than requested, so we artificially increase the
+        ;; height. See #325. Note this only has an effect if
+        ;; `which-key-allow-imprecise-window-fit' is non-nil.
+        (setf (which-key--pages-height result) which-key-min-display-lines))
       (which-key--debug-message "Frame height: %s
 Minibuffer height: %s
 Max dimensions: (%s,%s)